//
//  YKRetweetView.m
//  youkan
//
//  Created by mac mini on 16/3/3.
//  Copyright © 2016年 Honsintech. All rights reserved.
//

#import "YKRetweetView.h"
#import "YKStatusFrame.h"
#import "YKWBStatues.h"
#import "YKPhotosView.h"
@interface YKRetweetView()

@property(nonatomic,weak)    UILabel *nameView;
@property(nonatomic,weak)    UILabel *textView;
@property(nonatomic,weak)    YKPhotosView *photosView;

@end
@implementation YKRetweetView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self =[super initWithFrame:frame]) {
        [self setUpAllChildView];
        self.userInteractionEnabled = YES;
        self.image =[UIImage imageWithStretchableName:@"timeline_retweet_background"];
//        [UIImage imageNamed:@"timeline_retweet_background"];
    }
    return self;
}
//添加所有子控件
-(void)setUpAllChildView{
    //昵称
    UILabel *nameView=[[UILabel alloc]init];
    nameView.font = YKNameFont;
    [self addSubview:nameView];
    _nameView =nameView;
    _nameView.textColor =[UIColor blueColor];
    //正文
    UILabel *textView=[[UILabel alloc]init];
    textView.font =YKTextFont;
    textView.numberOfLines =0;
    [self addSubview:textView];
    _textView =textView;
    //    配图
    YKPhotosView *photosView=[[YKPhotosView alloc]init];
    [self addSubview:photosView];
    _photosView =photosView;
}
-(void)setStatusF:(YKStatusFrame *)statusF{
    _statusF = statusF;
    YKWBStatues *status =statusF.status;
//    昵称
    _nameView.frame =statusF.retNameF;
    _nameView.text =status.retweetName;
//    正文
    _textView.frame =statusF.retTextF;
    _textView.text =status.retweeted_status.text;
//    图片
    _photosView.frame =statusF.retPhotF;
    _photosView.pic_urls =status.retweeted_status.pic_urls;
}
@end
